package com.triz.business.service.impl;

import java.util.List;
import com.triz.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.triz.business.mapper.ExpectedGoalMapper;
import com.triz.business.domain.ExpectedGoal;
import com.triz.business.service.IExpectedGoalService;

/**
 * 预期目标Service业务层处理
 * 
 * @author hlk
 * @date 2025-11-11
 */
@Service
public class ExpectedGoalServiceImpl implements IExpectedGoalService 
{
    @Autowired
    private ExpectedGoalMapper expectedGoalMapper;

    /**
     * 查询预期目标
     * 
     * @param id 预期目标主键
     * @return 预期目标
     */
    @Override
    public ExpectedGoal selectExpectedGoalById(Long id)
    {
        return expectedGoalMapper.selectExpectedGoalById(id);
    }

    /**
     * 查询预期目标列表
     * 
     * @param expectedGoal 预期目标
     * @return 预期目标
     */
    @Override
    public List<ExpectedGoal> selectExpectedGoalList(ExpectedGoal expectedGoal)
    {
        return expectedGoalMapper.selectExpectedGoalList(expectedGoal);
    }

    /**
     * 新增预期目标
     * 
     * @param expectedGoal 预期目标
     * @return 结果
     */
    @Override
    public int insertExpectedGoal(ExpectedGoal expectedGoal)
    {
        expectedGoal.setCreateTime(DateUtils.getNowDate());
        return expectedGoalMapper.insertExpectedGoal(expectedGoal);
    }

    /**
     * 修改预期目标
     * 
     * @param expectedGoal 预期目标
     * @return 结果
     */
    @Override
    public int updateExpectedGoal(ExpectedGoal expectedGoal)
    {
        expectedGoal.setUpdateTime(DateUtils.getNowDate());
        return expectedGoalMapper.updateExpectedGoal(expectedGoal);
    }

    /**
     * 批量删除预期目标
     * 
     * @param ids 需要删除的预期目标主键
     * @return 结果
     */
    @Override
    public int deleteExpectedGoalByIds(Long[] ids)
    {
        return expectedGoalMapper.deleteExpectedGoalByIds(ids);
    }

    /**
     * 删除预期目标信息
     * 
     * @param id 预期目标主键
     * @return 结果
     */
    @Override
    public int deleteExpectedGoalById(Long id)
    {
        return expectedGoalMapper.deleteExpectedGoalById(id);
    }


}
